home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / f2c / may_5_92.lha / f2c.VMay_5_1992 / libF77 / sig_die.c < prev    next >
C/C++ Source or Header  |  1992-05-07  |  391b  |  29 lines

  1. #include "stdio.h"
  2. #include "signal.h"
  3.  
  4. #ifndef SIGIOT
  5. #define SIGIOT SIGABRT
  6. #endif
  7.  
  8.  void
  9. sig_die(s, kill)
  10. register char *s;
  11. int kill;
  12. {
  13.     /* print error message, then clear buffers */
  14.     extern void exit(), f_exit();
  15.     fprintf(stderr, "%s\n", s);
  16.     fflush(stderr);
  17.     f_exit();
  18.     fflush(stderr);
  19.  
  20.     if(kill)
  21.         {
  22.         /* now get a core */
  23.         signal(SIGIOT, SIG_DFL);
  24.         abort();
  25.         }
  26.     else
  27.         exit(1);
  28.     }
  29.